import config from "@/config"
import http from "@/utils/request"

export default {
    list: {
        url: `${config.API_URL}/adminapi/production.ProductionOrder/lists`,
        name: "获取生产单列表",
        get: async function(data={}){
            return await http.get(this.url, data);
        }
    },
    add: {
        url: `${config.API_URL}/adminapi/production.ProductionOrder/add`,
        name: "添加生产单",
        post: async function(data={}){
            return await http.post(this.url, data);
        }
    },
    edit: {
        url: `${config.API_URL}/adminapi/production.ProductionOrder/edit`,
        name: "修改生产单",
        post: async function(data={}){
            return await http.post(this.url, data);
        }
    },
    delete: {
        url: `${config.API_URL}/adminapi/production.ProductionOrder/delete`,
        name: "删除生产单",
        post: async function(data={}){
            return await http.post(this.url, data);
        }
    },
    detail: {
        url: `${config.API_URL}/adminapi/production.ProductionOrder/detail`,
        name: "生产单详情",
        get: async function(params){
            return await http.get(this.url, params);
        }
    },
    // 生产计划
    plan:{
        list: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/lists`,
            name: "获取生产计划列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        add: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/add`,
            name: "添加生产计划",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        edit: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/edit`,
            name: "修改生产计划",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        delete: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/delete`,
            name: "删除生产计划",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        detail: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/detail`,
            name: "生产计划详情",
            get: async function(params){
                return await http.get(this.url, params);
            }
        },
        check: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/checkStatus`,
            name: "生产计划审核",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        uncheck: {
            url: `${config.API_URL}/adminapi/production.ProductionPlan/uncheckStatus`,
            name: "生产计划反审核",
	        post: async function(params){
                return await http.post(this.url, params);
            }
        },
    },
    // 计划入库
    inhouse:{
        list: {
            url: `${config.API_URL}/adminapi/production.ProductionEntry/lists`,
            name: "获取入库列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        add: {
            url: `${config.API_URL}/adminapi/production.ProductionEntry/add`,
            name: "添加入库",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        edit: {
            url: `${config.API_URL}/adminapi/production.ProductionEntry/edit`,
            name: "修改入库",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        delete: {
            url: `${config.API_URL}/adminapi/production.ProductionEntry/delete`,
            name: "删除入库",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        detail: {
            url: `${config.API_URL}/adminapi/production.ProductionEntry/detail`,
            name: "入库详情",
            get: async function(params){
                return await http.get(this.url, params);
            }
        },
        check: {
            url: `${config.API_URL}/adminapi/production.ProductionEntry/checkStatus`,
            name: "入库审核",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        uncheck: {
            url: `${config.API_URL}/adminapi/production.ProductionEntry/uncheckStatus`,
            name: "入库反审核",
	        post: async function(params){
                return await http.post(this.url, params);
            }
        },
    },
    // 计划发货
    send:{
        list: {
            url: `${config.API_URL}/adminapi/production.ProductionDeliver/lists`,
            name: "获取发货列表",
            get: async function(data={}){
                return await http.get(this.url, data);
            }
        },
        add: {
            url: `${config.API_URL}/adminapi/production.ProductionDeliver/add`,
            name: "添加发货",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        edit: {
            url: `${config.API_URL}/adminapi/production.ProductionDeliver/edit`,
            name: "修改发货",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        delete: {
            url: `${config.API_URL}/adminapi/production.ProductionDeliver/delete`,
            name: "删除发货",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        detail: {
            url: `${config.API_URL}/adminapi/production.ProductionDeliver/detail`,
            name: "发货详情",
            get: async function(params){
                return await http.get(this.url, params);
            }
        },
        check: {
            url: `${config.API_URL}/adminapi/production.ProductionDeliver/checkStatus`,
            name: "发货审核",
            post: async function(data={}){
                return await http.post(this.url, data);
            }
        },
        uncheck: {
            url: `${config.API_URL}/adminapi/production.ProductionDeliver/uncheckStatus`,
            name: "发货反审核",
	        post: async function(params){
                return await http.post(this.url, params);
            }
        },
    },
}
